<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <title>优妈孕育信息管理平台 | 乐乐云</title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css">
    <link rel="stylesheet" href="http://cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- build:css login.min.css -->
    <link rel="stylesheet" href="plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="plugins/adminlte/css/AdminLTE.min.css">
    <link rel="stylesheet" href="plugins/iCheck/square/blue.css">
    <link rel="stylesheet" href="plugins/layer/layer.min.css">
    <!-- endbuild -->
    <style>
        body{font-family: 'Microsoft YaHei','宋体',sans-serif;font-size: 14px;}
        .login-box{min-width: 300px;}
        .input-code{width: calc(100% - 150px);display: inline-block;vertical-align: middle}
        .code-box{width: 150px;float: right;cursor: pointer;text-align: right}
        .img-code{vertical-align: middle;height: 34px;width: 110px;margin-right: 5px;}
    </style>
</head>
<body class="hold-transition login-page">
<div class="login-box">
    <div class="login-logo">
        <a href="javascript:;">乐乐云</a>
    </div>
    <div class="login-box-body">
        <p class="login-box-msg">优妈孕育信息管理平台</p>
        <form id="loginForm" onsubmit="return false;">
            <div class="form-group has-feedback">
                <input id="username" type="text" class="form-control" placeholder="账号">
                <span class="fa fa-user form-control-feedback"></span>
            </div>
            <div class="form-group has-feedback">
                <input id="password" type="password" class="form-control" placeholder="密码">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            </div>
            <div class="row">

                <div class="col-xs-4 col-xs-offset-8">
                    <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- build:js login.min.js -->
<script src="plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="plugins/layer/layer.min.js"></script>
<script src="plugins/iCheck/icheck.min.js"></script>
<script src="plugins/md5/md5.js"></script>
<script src="base.js"></script>
<!-- endbuild -->
<script>
    $(function () {
//        $('input').iCheck({
//            checkboxClass: 'icheckbox_square-blue',
//            radioClass: 'iradio_square-blue',
//            increaseArea: '20%' // optional
//        });

        $("#loginForm button").click(function(){
            var username = $("#username").val();
            var password = $("#password").val();
            $.ajax({
                url:baseUrl+'/smUser/login',
                type:'post',
                data:{
                    loginId: username,
                    loginPwd: hex_md5(password).toLocaleUpperCase()
                },
                success:function(res){
                    var resData=JSON.parse(res);
                    console.log(resData)
                    if(resData.code =='000'){
                        localStorage.userName = resData.data.userName;
                        localStorage.token = resData.data.token;
                        localStorage.userId = resData.data.userId;
                        location.href='./index.html'
                    }else{
                       layer.msg(resData.msg);
                    }
                }

            });
        });
    });
</script>
</body>
</html>